import React, { PureComponent } from 'react';
import Map_list from './map_list'

import {
  View,
  ListView,
  Text
} from 'react-native';

import { public_Style as styles } from '../../../../styles';

const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) =>  r1 !== r2  });//listView 数据判断方式
export default class Map_c extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      uploading: true, //下拉刷新按钮状态 (初始化加载时处在loading状态)
      dwloading: false, //上拉刷新按钮状态
    };
    this.isFirst = true                         //页面第一次加载
  }

  //加载后渲染页面
  componentDidMount() {
  }


  render() {
    //获取用户列表数据及是否等待状态
    const { data } = this.props;
    //创建listView数据源
    const dataSource = ds.cloneWithRows(data);
    return (
      <View>
        <ListView
          enableEmptySections={true}
          dataSource={dataSource}
          renderRow={this.renderRow.bind(this)}
          contentContainerStyle={styles.maplist}
        />
      </View>
    );
  }

  renderRow(rowData) {
    return (
      <Map_list
        detail={rowData}
        navigation={this.props.navigation}
      />
      // <View><Text>nhfkjsnkfsj</Text></View>
    )
  }

}
